#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <tchar.h>
#include "urlctrl.h"
#include "resource.h"

#ifdef __BORLANDC__
#pragma argsused //disable warning (param not used)
#endif
BOOL CALLBACK DlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{	switch(uMsg)
	{	case WM_INITDIALOG:
		{	COLORREF unvisited=RGB(255,0,0);
			COLORREF visited=RGB(0,255,0);
			HWND h=GetDlgItem(hwnd,IDC_HYPERLINK1);
			urlctrl_set(h,_T("http://www.google.com/"),
				NULL,NULL,UCF_KBD|UCF_FIT);
			h=GetDlgItem(hwnd,IDC_HYPERLINK2);
			urlctrl_set(h,_T("http://www.catch22.net/tuts/"),
				&unvisited,&visited,0);
			urlctrl_fit(h);
			return TRUE;
		}
		case WM_COMMAND:
		{	switch(LOWORD(wParam))
			{	case IDCANCEL:
				case IDOK:
					EndDialog(hwnd,0);
					return TRUE;
			}
			return FALSE;
		}
	}
	return FALSE;
}

#ifdef __BORLANDC__
#pragma argsused //disable warning (param not used)
#endif
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR pszCmd,int nShow)
{	
	DialogBox(hInst,MAKEINTRESOURCE(IDD_DIALOG1),NULL,DlgProc);
	return 0;
}
